Skip to content

docs: repository maturity audit — report, security policy, diagrams, index cleanup#981

Merged
BigSimmo merged 11 commits into
mainfrom
claude/repository-maturity-audit-yx5hdp
Jul 20, 2026
Merged

docs: repository maturity audit — report, security policy, diagrams, index cleanup#981
BigSimmo merged 11 commits into
mainfrom
claude/repository-maturity-audit-yx5hdp

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Summary

Repository maturity, mapping, and organisation audit for Clinical KB, plus a small set of safe, reversible improvements. No source, API, schema, auth, retrieval, or deployment behaviour changed — documentation and non-behavioural config only.

  • Audit report: docs/audit/2026-07-20-repository-maturity.md — project profile, current map, a maturity gap matrix (35 rows across the assessment domains), target structure, a repository-host settings checklist, risks/assumptions, and a Now/Next/Later/Not-recommended backlog. Headline finding: the repo is already High maturity (top-decile CI/CD, security, migrations, testing, docs); the right work is pruning/indexing/diagramming, not adding scaffolding.
  • Security policy: new SECURITY.md (private vulnerability-reporting channel + links to the existing threat models); README security pointer. This was the one genuinely-missing governance file.
  • License: declared proprietary — "license": "UNLICENSED" in package.json + a one-line README note (ownership/intent are known; this is not an OSS license).
  • Architecture diagrams: the first Mermaid diagrams in the repo — deployment/container topology, the ingestion state machine, and the answer/RAG request flow — added inline to deployment-architecture.md, ingestion-state-machine.md, and codebase-index.md.
  • Docs index + archive: fixed the docs/README index (added 7 orphaned living docs; softened the "everything" over-claim) and moved 5 completed/misplaced point-in-time docs to docs/archive/ per the repo's own maintenance rule. source-review-priority-2026-07-02.md was deliberately left in place — it is referenced by the live governance-debt manifest release-source-metadata-debt-2026-06-30.json.
  • Stale self-descriptions: corrected a CI-coverage-script comment ("Not in CI" → it runs in CI + verify:cheap) and the bundle-budget CI step label ("warn-only" → the budget is now enforced with a committed baseline).

Verification

Docs + non-behavioural config only; the relevant gates all pass:

  • npm run docs:check-links — pass (937 repo path refs resolve)
  • npm run docs:check-scripts — pass (305 npm-run refs)
  • npm run docs:check-index — pass (38 modules/routes + all schema tables)
  • npm run format:check — pass (Prettier clean)
  • npm run check:runtime — pass (Node 24.13.0 / npm 11.6.2)
  • npm run check:github-actions — pass (pins/YAML valid after the ci.yml label edit)

Verification not run: npm run verify:pr-local / verify:ui / evals — no source, UI, retrieval, answer, or schema behaviour changed; CI runs the full gate on this PR.

Risk and rollout

  • Risk: Minimal — documentation plus metadata/comment/label edits; 5 history-preserving git mv renames with inbound links retargeted and verified by docs:check-links.
  • Rollback: revert the PR; every change is additive documentation or a reversible rename.
  • Provider or production effects: None.

Clinical Governance Preflight

N/A — no ingestion, answer generation, search/ranking, source rendering, document access, privacy, production-env, or clinical-output behaviour changed. The Supabase target and the service-role/private-document-access boundaries are untouched.

Notes

  • The src/lib domain-directory restructure, monolith decomposition (rag.ts, ClinicalDashboard.tsx), an import-boundary linter, and SAST-blocking on the parser path are intentionally deferred to the backlog in the report — each warrants its own PR plus full-suite verification.
  • Mermaid diagrams use GitHub-native syntax (verified by hand; the Mermaid validation MCP tool required interactive approval that was unavailable in this run).

Generated by Claude Code

Summary by CodeRabbit

  • Documentation

    • Added security reporting guidance, including responsible disclosure instructions and supported components.
    • Added proprietary licensing information and clarified that redistribution and reuse are not permitted.
    • Expanded architecture, deployment, ingestion, retrieval, governance, and operational documentation.
    • Added historical audit and archive records and corrected several documentation links.
  • Quality Improvements

    • Bundle-size growth checks are now enforced during continuous integration.
    • Documentation index coverage checks now block verification when gaps are detected.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@BigSimmo, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 7 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8bb31e51-f93e-4ea8-b1da-d7357b323415

📥 Commits

Reviewing files that changed from the base of the PR and between 7faebaa and 8576dda.

📒 Files selected for processing (2)
  • docs/audit/2026-07-20-repository-maturity.md
  • docs/ingestion-state-machine.md
📝 Walkthrough

Walkthrough

This PR adds repository security and licensing documentation, expands documentation indexes and archives, introduces architecture and lifecycle diagrams, records a repository maturity audit, and updates CI guidance to describe bundle-budget and codebase-index checks as enforced.

Changes

Repository governance and documentation

Layer / File(s) Summary
Security policy and license declaration
SECURITY.md, README.md, package.json
Adds private vulnerability-reporting guidance, security scope and handling rules, and declares the repository as UNLICENSED with matching README licensing text.
CI check enforcement guidance
.github/workflows/ci.yml, scripts/check-bundle-budget.mjs, scripts/check-codebase-index-coverage.mjs
Updates descriptions to identify bundle-budget enforcement and blocking codebase-index coverage checks.
Documentation index and archive records
docs/README.md, docs/archive/*
Adds documentation index entries and archive records, and corrects relative links in archived governance and design documents.
Architecture diagrams and maturity audit
docs/codebase-index.md, docs/deployment-architecture.md, docs/ingestion-state-machine.md, docs/audit/2026-07-20-repository-maturity.md
Documents answer, deployment, and ingestion flows with Mermaid diagrams and adds a repository maturity audit covering verification results, manual repository-host actions, risks, and backlog items.

Estimated code review effort: 2 (Simple) | ~15 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: repository maturity audit, security policy, diagrams, and documentation cleanup.
Description check ✅ Passed The description matches the template well and includes summary, verification, risk/rollout, governance preflight, and notes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/repository-maturity-audit-yx5hdp

Comment @coderabbitai help to get the list of available commands.

@supabase

supabase Bot commented Jul 20, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@BigSimmo
BigSimmo marked this pull request as ready for review July 20, 2026 10:07
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/audit/2026-07-20-repository-maturity.md`:
- Around line 30-31: Reconcile the “Most important risks” summary with the
`Security-reporting policy` entry in the maturity matrix so both use one
authoritative severity statement; either remove the High priority from the
matrix or update the summary to acknowledge it, while preserving the intended
risk classification.
- Around line 167-173: Add the text language identifier to the opening fenced
code block surrounding the repository directory listing, leaving the block
contents unchanged.

In `@docs/ingestion-state-machine.md`:
- Around line 31-37: Update the documents.status state transitions in the
diagram: show atomic reindex enqueue from indexed as remaining indexed while
creating a pending ingestion job, and distinguish the non-atomic reindex path
that transitions indexed to queued. Also add the processing-to-queued transition
for retry, while preserving the existing processing-to-failed and terminal
indexed transitions.
🪄 Autofix (Beta)

❌ Autofix failed (check again to retry)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d2f75e04-2571-41ae-a34b-35c457721773

📥 Commits

Reviewing files that changed from the base of the PR and between 63b1a91 and 7faebaa.

📒 Files selected for processing (16)
  • .github/workflows/ci.yml
  • README.md
  • SECURITY.md
  • docs/README.md
  • docs/archive/BRANCH_ARCHIVE_20260709.md
  • docs/archive/design-qa-2026-07-15.md
  • docs/archive/project-alignment-cleanup.md
  • docs/archive/source-governance-priorities-2026-07-02.md
  • docs/archive/source-governance-status-2026-07-08.md
  • docs/audit/2026-07-20-repository-maturity.md
  • docs/codebase-index.md
  • docs/deployment-architecture.md
  • docs/ingestion-state-machine.md
  • package.json
  • scripts/check-bundle-budget.mjs
  • scripts/check-codebase-index-coverage.mjs

Comment thread docs/audit/2026-07-20-repository-maturity.md Outdated
Comment thread docs/audit/2026-07-20-repository-maturity.md Outdated
Comment thread docs/ingestion-state-machine.md
@BigSimmo
BigSimmo enabled auto-merge (squash) July 20, 2026 10:19
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

⚠️ Branch updated during autofix.

The branch was updated while autofix was in progress. Please try again.

BigSimmo and others added 3 commits July 20, 2026 18:23
ok

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
- State the one High-priority gap (missing SECURITY.md, row 35) is closed
  in this PR so the summary and maturity matrix agree on severity.
- Add the `text` language identifier to the src/lib restructure fence
  (markdownlint MD040).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H5TymRtbrygE4HiaDgiAFo
@BigSimmo
BigSimmo merged commit 580d614 into main Jul 20, 2026
36 checks passed
@BigSimmo
BigSimmo deleted the claude/repository-maturity-audit-yx5hdp branch July 20, 2026 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants